# -*- coding: utf-8 -*-
"""
Module Description: 拦截器基类
"""


class BaseInterceptor(object):
    """
    拦截器基类
    使用静态方法,降低并发高时对象创建数量

    大多数情况下只需要实现pre_process()方法即可
    """

    @staticmethod
    def pre_process(request, response):
        """
        前置逻辑
        :param request:
        :param response:
        :return: bool, 返回False则不继续往下执行
        """
        return True

    @staticmethod
    def post_process(request, response):
        """
        后置逻辑,仅当pre_process返回True时才会执行到
        :param request:
        :param response:
        """
